package com.example.zhugenew.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.example.mymvplibrary.adapter.BaseAdapter;
import com.example.mymvplibrary.adapter.BaseViewHolder;
import com.example.zhugenew.R;
import com.example.zhugenew.bean.BeiJingZhanBean;

import java.util.List;

public class BeiJingZhanAdapter extends BaseAdapter<BeiJingZhanBean.ListnewsBean> {

    public BeiJingZhanAdapter(List<BeiJingZhanBean.ListnewsBean> datas, Context context, int layoutId) {
        super(datas, context, layoutId);
    }

    @Override
    public void bindData(BaseViewHolder holder, BeiJingZhanBean.ListnewsBean listnewsBean, int pos) {
        TextView tv_real = holder.getView(R.id.tv_real);
        TextView tv_title = holder.getView(R.id.tv_title1);
        TextView tv_haidian = holder.getView(R.id.tv_haidian);
        ImageView iv_real = holder.getView(R.id.iv_image_real);
        Glide.with(context).load(listnewsBean.getThumb()).into(iv_real);

        tv_real.setText(listnewsBean.getTitle());
        tv_title.setText(listnewsBean.getDescription());
        tv_haidian.setText(listnewsBean.getSource_info().getSource_title());
    }
}
 